{% extends "base.html" %}
{% block head %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/ctf.css') }}">
{{super()}}
{% endblock %}
{% block page_content %}
    {% if current_user.is_authenticated() %}
    <div class="container">
    <div class="row">
    <div class="alert alert-info">
    Hello, <strong>{{ current_user.username }}</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Your rank is {{ranking}}<span class="pull-right badge badge-info">
    {{ current_user.score }}</span>
    </div>
    </div>
    </div>
    {% endif %}

    <div class="row">
  		<div class="col-md-12">
  			<div class="row">
  				<div class="col-md-2">
  				</div>
  				<div id="bodytd" class="col-md-8"><br><br>
            {% set list = ['#57d833' , '#564aee', '#8e43c9', '#ffa800', '#ea0221']%}
            {% for challenge in challenges %}
            {% if challenge.score|int < 300 %}
            <a href='/challenges/{{challenge.name}}' class='tile {{ 'solved' if challenge.name in current_user.solved else '' }}' style='background-color: {{ list|random }}; text-decoration: none'>
            <span class='cat'>{{challenge.category}}</span><br/><span class='cost'>{{challenge.score}}</span><br/>
            <span class='desc'>{{challenge.name}}</span></a>
            {% else %}
            <a href='/challenges/{{challenge.name}}' class='tile big {{ 'solved' if challenge.name in current_user.solved else '' }}' style='background-color: {{ list|random }}; text-decoration: none'>
            <span class='cat'>{{challenge.category}}</span><br/><span class='cost'>{{challenge.score}}</span><br/>
            <span class='desc'>{{challenge.name}}</span></a>
            {% endif %}
            {% endfor %}
          </div>
  				<div class="col-md-2">
  				</div>
  			</div>
  		</div>
  	</div>
{% endblock %}
